.class Lcom/melesta/engine/EngineGLSurfaceView$2;
.super Landroid/os/Handler;
.source "EngineGLSurfaceView.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/melesta/engine/EngineGLSurfaceView;->initView()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/melesta/engine/EngineGLSurfaceView;


# direct methods
.method constructor <init>(Lcom/melesta/engine/EngineGLSurfaceView;)V
    .locals 0
    .parameter

    .prologue
    .line 95
    iput-object p1, p0, Lcom/melesta/engine/EngineGLSurfaceView$2;->this$0:Lcom/melesta/engine/EngineGLSurfaceView;

    invoke-direct {p0}, Landroid/os/Handler;-><init>()V

    return-void
.end method


# virtual methods
.method public handleMessage(Landroid/os/Message;)V
    .locals 7
    .parameter "msg"

    .prologue
    const/4 v6, 0x0

    .line 98
    iget-object v4, p0, Lcom/melesta/engine/EngineGLSurfaceView$2;->this$0:Lcom/melesta/engine/EngineGLSurfaceView;

    #getter for: Lcom/melesta/engine/EngineGLSurfaceView;->mCocos2dxEditText:Lcom/melesta/engine/EngineEditText;
    invoke-static {v4}, Lcom/melesta/engine/EngineGLSurfaceView;->access$000(Lcom/melesta/engine/EngineGLSurfaceView;)Lcom/melesta/engine/EngineEditText;

    move-result-object v0

    .line 99
    .local v0, editText:Lcom/melesta/engine/EngineEditText;
    invoke-static {}, Lcom/melesta/engine/EngineGLSurfaceView;->access$100()Lcom/melesta/engine/EngineGLSurfaceView;

    move-result-object v1

    .line 100
    .local v1, glSurfaceView:Lcom/melesta/engine/EngineGLSurfaceView;
    iget v4, p1, Landroid/os/Message;->what:I

    packed-switch v4, :pswitch_data_0

    .line 125
    :cond_0
    :goto_0
    return-void

    .line 102
    :pswitch_0
    if-eqz v0, :cond_0

    invoke-virtual {v0}, Lcom/melesta/engine/EngineEditText;->requestFocus()Z

    move-result v4

    if-eqz v4, :cond_0

    .line 103
    invoke-static {}, Lcom/melesta/engine/EngineGLSurfaceView;->access$200()Lcom/melesta/engine/EngineTextInputWraper;

    move-result-object v4

    invoke-virtual {v0, v4}, Lcom/melesta/engine/EngineEditText;->removeTextChangedListener(Landroid/text/TextWatcher;)V

    .line 104
    const-string v4, ""

    invoke-virtual {v0, v4}, Lcom/melesta/engine/EngineEditText;->setText(Ljava/lang/CharSequence;)V

    .line 105
    iget-object v3, p1, Landroid/os/Message;->obj:Ljava/lang/Object;

    check-cast v3, Ljava/lang/String;

    .line 106
    .local v3, text:Ljava/lang/String;
    invoke-virtual {v0, v3}, Lcom/melesta/engine/EngineEditText;->append(Ljava/lang/CharSequence;)V

    .line 107
    invoke-static {}, Lcom/melesta/engine/EngineGLSurfaceView;->access$200()Lcom/melesta/engine/EngineTextInputWraper;

    move-result-object v4

    invoke-virtual {v4, v3}, Lcom/melesta/engine/EngineTextInputWraper;->setOriginText(Ljava/lang/String;)V

    .line 108
    invoke-static {}, Lcom/melesta/engine/EngineGLSurfaceView;->access$200()Lcom/melesta/engine/EngineTextInputWraper;

    move-result-object v4

    invoke-virtual {v0, v4}, Lcom/melesta/engine/EngineEditText;->addTextChangedListener(Landroid/text/TextWatcher;)V

    .line 109
    invoke-virtual {v1}, Lcom/melesta/engine/EngineGLSurfaceView;->getContext()Landroid/content/Context;

    move-result-object v4

    const-string v5, "input_method"

    invoke-virtual {v4, v5}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputMethodManager;

    .line 110
    .local v2, imm:Landroid/view/inputmethod/InputMethodManager;
    invoke-virtual {v2, v0, v6}, Landroid/view/inputmethod/InputMethodManager;->showSoftInput(Landroid/view/View;I)Z

    .line 111
    const-string v4, "GLSurfaceView"

    const-string v5, "showSoftInput"

    invoke-static {v4, v5}, Lcom/melesta/engine/Log;->d(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    .line 116
    .end local v2           #imm:Landroid/view/inputmethod/InputMethodManager;
    .end local v3           #text:Ljava/lang/String;
    :pswitch_1
    if-eqz v0, :cond_0

    .line 117
    invoke-static {}, Lcom/melesta/engine/EngineGLSurfaceView;->access$200()Lcom/melesta/engine/EngineTextInputWraper;

    move-result-object v4

    invoke-virtual {v0, v4}, Lcom/melesta/engine/EngineEditText;->removeTextChangedListener(Landroid/text/TextWatcher;)V

    .line 118
    invoke-virtual {v1}, Lcom/melesta/engine/EngineGLSurfaceView;->getContext()Landroid/content/Context;

    move-result-object v4

    const-string v5, "input_method"

    invoke-virtual {v4, v5}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/view/inputmethod/InputMethodManager;

    .line 119
    .restart local v2       #imm:Landroid/view/inputmethod/InputMethodManager;
    invoke-virtual {v0}, Lcom/melesta/engine/EngineEditText;->getWindowToken()Landroid/os/IBinder;

    move-result-object v4

    invoke-virtual {v2, v4, v6}, Landroid/view/inputmethod/InputMethodManager;->hideSoftInputFromWindow(Landroid/os/IBinder;I)Z

    .line 120
    iget-object v4, p0, Lcom/melesta/engine/EngineGLSurfaceView$2;->this$0:Lcom/melesta/engine/EngineGLSurfaceView;

    invoke-virtual {v4}, Lcom/melesta/engine/EngineGLSurfaceView;->requestFocus()Z

    .line 121
    const-string v4, "GLSurfaceView"

    const-string v5, "HideSoftInput"

    invoke-static {v4, v5}, Lcom/melesta/engine/Log;->d(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_0

    .line 100
    :pswitch_data_0
    .packed-switch 0x2
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method
